{% extends 'base.html' %}

{% block title %}{{ task.name }}{% endblock %}

{% block content %}
    <h2>{{ task.name }}</h2>
    <p class="project">for <a href='{{ task.project.url }}'>{{ task.project.name }}</a></p>
    <div id="description">
        {{ task.description|linebreaks }}
    </div>
    {% if usertask %}
    <div id="actions">
        {% ifequal usertask.state 0 %}<a href='{% url start_task slug=usertask.task.slug %}'>start this task</a>{% endifequal %}
        {% ifequal usertask.state 1 %}<a href='{% url complete_task slug=usertask.task.slug %}'>say you've completed this task</a>{% endifequal %}
        {% ifequal usertask.state 2 %}ignored{% endifequal %}
        {% ifequal usertask.state 3 %}completed!{% endifequal %}
    </div>
    {% endif %}
    
    <h3>People currently doing this task</h3>
    <ul id="taskusers">
    {% for task_user in task.get_started_users %}
        <li>{{ task_user.user.display_name }}</li>
    {% endfor %}
    </ul>
{% endblock %}